//
//  HYOUBabyCollectionViewCell.m
//  BestGift
//
//  Created by 温晓宇 on 16/1/13.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HYOUBabyCollectionViewCell.h"

@interface HYOUBabyCollectionViewCell ()

@property(nonatomic, retain)UIImageView *iconImageView;
@property(nonatomic, retain)UILabel *nameLabel;

@end

@implementation HYOUBabyCollectionViewCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}
-(void)createSubViews{
    self.iconImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 0, 55, 55)];
    //        self.iconImageView = [[ZYYBaseImageView alloc]initWithFrame:CGRectMake(0, self.contentView.frame.size.width, self.contentView.frame.size.height, 60)];
    [self.contentView addSubview:self.iconImageView];
    
    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 65, 70, 30)];
    [self.contentView addSubview:self.nameLabel];
    self.nameLabel.textAlignment = NSTextAlignmentCenter;
}
-(void)setModel:(HYOUGift *)model{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    NSURL *url = [NSURL URLWithString:self.model.icon_url];
    [self.iconImageView sd_setImageWithURL:url];
    self.nameLabel.text = self.model.name;
    self.nameLabel.font = [UIFont systemFontOfSize:15];
}
@end
